

//1. 给输入账号绑定focus事件， 清空文本框的内容
let account = document.getElementById('account');
account.onfocus = function(){
	account.value = '';
}


//2. 各下拉框绑定一个 值改变的事件， 设置商品的单价
let txtPrice = document.getElementById('price');
let produce = document.getElementsByName('product')[0];
produce.onchange = function(){
	txtPrice.value = produce.value;
	//获取总计
	let total = document.getElementById('total');
	//设置总计的值
	total.value = count.value * txtPrice.value;
}

//3. 各数量绑定一个 值改变的事件， 设置商品的总价
let count =  document.getElementById('count');
count.onchange = function(){
	//获取总计
	let total = document.getElementById('total');
	//设置总计的值
	total.value = count.value * txtPrice.value;
}


//4.给提交按钮绑定一个点击事件， 弹出结果提示框
	
let save =document.getElementById('save');
save.onclick = function(){
	//获取总计
	let total = document.getElementById('total');
	//设置总计的值
	total.value = count.value * txtPrice.value;
	alert("总价为：" + total.value)
}
